<template>
  <view class="lucky-draw" :style="[grayScaleStyle]">
    <!-- Header with back button -->
	<image class="bg" src="http://sq85owu9k.hb-bkt.clouddn.com/lingpin/static/lottery/bg.png" mode="widthFix"></image>
	<view class="custom-nav" :style="{ paddingTop: statusBarHeight + 'px' }">
	  <view class="nav-content">
	    <view class="left-area" @click="goBack">
	      <text class="iconfont icon-more trasnicon" ></text>
	      <text class="nav-title">消费抽奖</text>
	    </view>
	  </view>
	</view>
	<view class="" :style="{ paddingTop: navHeight + 'px' }"></view>
	

    <!-- Winners list board -->
    <view class="winners-board">
		<image class="bgimg" src="http://sq85owu9k.hb-bkt.clouddn.com/lingpin/static/lottery/img_title.png" mode="widthFix"></image>
      <!-- <view class="board-title">获奖名单</view> -->
      <view class="winner-list">
        <view class="winner-list-content" >
          <view class="winner-item" v-for="(winner, index) in winners" :key="index">
            <text class="winner-name">恭喜用户：{{winner.name}} </text>
            <text class="line">——</text>
            <text class="winner-prize">获得特等奖：{{winner.prize}}</text>
          </view>
          <!-- 复制一份列表实现无缝效果 -->
          <view class="winner-item" v-for="(winner, index) in winners" :key="index">
            <text class="winner-name">恭喜用户：{{winner.name}} </text>
            <text class="line">——</text>
            <text class="winner-prize">获得特等奖：{{winner.prize}}</text>
          </view>
        </view>
      </view>
	  
    </view>
	
	<view class="wheel-main">
		<image class="wheel-bg" src="http://sq85owu9k.hb-bkt.clouddn.com/lingpin/static/lottery/img1.png" mode="widthFix"></image>
		<view class="wheel-main-box">
			<image class="wheel-bg2" src="http://sq85owu9k.hb-bkt.clouddn.com/lingpin/static/lottery/img2.png" mode="widthFix"></image>
			<view class="wheel-btn" >
			  <view class="wheel-btn-title">抽奖</view>
			  <view class="wheel-btn-txt">次数 x {{userInfo.coupons}}</view>
			</view>
		</view>
	</view>

	<view class="box">
		<view class="box-main">
				<view class="title">抽奖须知</view>
				<view class=""> 另品网的会员在另品网合作商家消费，在抽奖活动进行期间，每在任意商家产生一笔有效消费，都可获取另品网抽奖券一张，有效抽奖期为21天，过期则奖券作废。</view>
		</view>
	</view>
  </view>
</template>

<script lang="ts" src="./index.ts"></script> 
<style lang="scss" scoped>
.lucky-draw {
  min-height: 100vh;
  // background: linear-gradient(180deg, #FF4444 0%, #FF7744 100%);
  .bg{
	  width: 100%;
	  height: 100%;
	  position: fixed;
	  z-index: -1;
  }
  
  .custom-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
  	// background: url('http://sq85owu9k.hb-bkt.clouddn.com/lingpin/static/background.jpg');    
  	.trasnicon{
  	  transform: rotate(180deg);
    }
    .nav-content {
  	height: 44px;
  	display: flex;
  	align-items: center;
  	justify-content: space-between;
  	padding: 0 12px;
  	background: transparent;
  	
  	.left-area {
  	  display: flex;
  	  align-items: center;
  	  .iconfont {
  		font-size: 16px;
  		color: #fff;
  		margin-right: 8px;
  	  }
  	  .nav-title {
  		font-size: 16px;
  		color: #fff;
  		font-weight: 500;
  	  }
  	}
  	
  	
    }
  }

  .winners-board {
	width: 100%;
	margin: 0 auto;
	height: 270rpx;
	position: relative;
	z-index: 6;
	padding: 0 20rpx;
	// padding-top: 30rpx;
	.bgimg{
		width: 100%;
		height: 270rpx;
		// position: absolute;
		// z-index: -1;
	}
	.winner-list{
		position: absolute;
		width: 84%;
		left: 8%;
		bottom: 60rpx;
		height: 120rpx;
		background: #fff;
		overflow: hidden;
		border-radius: 6px;
		box-shadow: 0px 0px 6px 0px #ff863c inset; 
		// padding: 10rpx 0;
		.winner-list-content {
			 animation: scrollUp 8s linear infinite;
			// &:hover {
			// 	animation-play-state: paused;
			// }
		}
	}
    .winner-item {
		font-size: 20rpx;
		font-family: Segoe UI, Segoe UI-Regular;
		text-align: center;
		color: #666;
		letter-spacing: 0.1px;
		margin-top: 10rpx;
		.line{
			margin: 0 10rpx;
		}
    }
  }
	
	.wheel-main{
		width: 100%;
		position: relative;
		z-index: 7;
		top: -100rpx;
		.wheel-bg{
			width: 100%;
		}
		.wheel-main-box{
			width: 484rpx;
			position: absolute;
			top: 222rpx;
			left: 150rpx;
			.wheel-bg2{
				width: 100%;
			}
			.wheel-btn {
			  position: absolute;
			  left: 50%;
			  top: 50%;
			  transform: translate(-50%, -50%);
			  width: 150rpx;
			  height: 150rpx;
			  // background: #FF4444;
			  border-radius: 50%;
			  display: flex;
			  flex-direction: column;
			  align-items: center;
			  justify-content: center;
			  color: #fff;
			  font-size: 28rpx;
			  // box-shadow: 0 0 20rpx rgba(0,0,0,0.2);
			  .wheel-btn-title{
				  font-size: 28px;
				  text-align: center;
				  color: #ffffff;
				  letter-spacing: -0.56px;
			  }
			  .wheel-btn-txt{
				  font-size: 12px;
				  text-align: center;
				  color: #ffffff;
				  letter-spacing: -0.24px;
			  }
			}
		}
	}

	.box{
		position: fixed;
		bottom: 4vh;
		left: 2%;
		width: 96%;
		background-color: #fff;
		border-radius: 10rpx;
		height: 360rpx;
		padding: 20rpx;
		.box-main{
			width: 100%;
			height: 100%;
			box-shadow: 0px 0px 20px 0px #f8c3a1 inset; 
			padding: 20rpx;
			font-size: 22rpx;
			color: #555;
			text-indent: 2em;
			line-height: 40rpx;
			.title{
				font-size: 26rpx;
				color: #000;
				width: 100%;
				text-align: center;
				margin-bottom: 10rpx;
			}
			
		}
	}
  .wheel-container {
    position: relative;
    padding-top: 40rpx;
    
    .wheel-wrapper {
      width: 600rpx;
      height: 600rpx;
      margin: 0 auto;
      position: relative;
    }
    
    .wheel {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      background: #FF6633;
      position: relative;
      transition: transform 3s ease-out;
      border: 20rpx solid #FFB74D;
    }
    
    .wheel-item {
      position: absolute;
      width: 50%;
      height: 50%;
      transform-origin: 100% 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
    }
    
    
  }
}

@keyframes scrollUp {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}
</style>
